// By Will Dresh

using System;
using System.Collections.Generic;

namespace WillsTuringMachines
{
	public class BasicTuringMachine: ITuringMachine
	{
		/*
		 * According to the great & mighty Wikipedia...
		 * A Turing Machine M is defined by
		 * M = (Q,Rho,b,Sigma,delta,q0,F)
		 *	Q 	: A finite, non-empty set of states
		 *	Rho	: A finite, non-empty set of the tape alphabet
		 *	b `elem` Rho : the "blank symbol"
		 *	Sigma = Rho - {b}
		 *	q0	: initial state
		 *	F `subset` Q : Set of final aka accepting states
		 *	delta : A function mapping:
		 *		Q \ F X R -> Q X R X {L,R}
		*/ 

		private ISet<object> stateAlphabet;	// Q
		private ISet<object> tapeAlphabet;	// Rho
		private object blankSymbol;			// b
		private object initialState;		// q0
		private ISet<object> finalStates;	// F

		public BasicTuringMachine ()
		{ }

		public BasicTuringMachine(ISet<object> _stateAlphabet, ISet<object> _tapeAlphabet, object _blankSymbol, object _initialState, ISet<object> _finalStates)
		{
			stateAlphabet = _stateAlphabet;
			tapeAlphabet = _tapeAlphabet;
			blankSymbol = _blankSymbol;
			initialState = _initialState;
			finalStates = _finalStates;
		}

		#region ITuringMachine implementation
		public ISet<object> StateAlphabet {
			get {
				return stateAlphabet;
			}
			set {
				stateAlphabet = value;
			}
		}

		public ISet<object> TapeAlphabet {
			get {
				return tapeAlphabet;
			}
			set {
				tapeAlphabet = value;
			}
		}

		public object BlankSymbol {
			get {
				return blankSymbol;
			}
			set {
				blankSymbol = value;
			}
		}

		public object InitialState {
			get {
				return initialState;
			}
			set {
				initialState = value;
			}
		}

		public ISet<object> FinalStates {
			get {
				return finalStates;
			}
			set {
				finalStates = value;
			}
		}
		#endregion

	}
}

